#ifndef JOLFS_VOLUME_LOCAL_H
#define JOLFS_VOLUME_LOCAL_H

#include <string>

#include "volume.h"
#include "entry.h"

namespace jolfs
{
  class LocalVolume : public Volume
  {
  public:
    LocalVolume( const std::string& name, const std::string& path );
    LocalVolume( const LocalVolume& );
    ~LocalVolume();
    
  public:
    bool load( const std::string& path );
    
  public:
    virtual void addEntry( Entry* );
    
    virtual EntryList    getEntries() const;
    virtual Entry*       getRoot   ();
    virtual const Entry* getRoot   () const;
    virtual const Entry* getEntry( const std::string& path ) const;
    virtual Entry*       getEntry( const std::string& path );
    
  private:
    void loadDirectory( const std::string& path, Entry* parent );
    
  protected:
    Entry       root_;
    std::string path_;
  };
} // namespace jolfs

#endif // JOLFS_VOLUME_LOCAL_H
